package com.ctl.lib_common.base

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * created by : chentl
 * Date: 2021/01/05
 */
class ViewPagerFragmentStateAdapter(fragment: Fragment, private val fragmentList: MutableList<Fragment>) :
    FragmentStateAdapter(fragment) {

    override fun getItemCount(): Int {
        return fragmentList.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragmentList[position]
    }
}